home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993 April: Penguin on DISC / ADC Developer CD (1993-04) (''Penguin On DISC'')_iso / Dev.CD Apr 93.iso / System Software / System Extensions / AppleScript Beta / Development Tools / Interfaces / CIncludes / AppleScript.h < prev    next >
Encoding:
Text File  |  1992-11-19  |  4.7 KB  |  130 lines  |  [TEXT/MPS ]

  1. ////////////////////////////////////////////////////////////////////////////////
  2. // OPEN SCRIPTING ARCHITECTURE: AppleScript Specific Interface
  3. ////////////////////////////////////////////////////////////////////////////////
  4. // Copyright © 1992 Apple Computer, Inc. All rights reserved.
  5. // Authors: William Cook, Donn Denman, and Warren Harris
  6. //
  7. // 10/26/92 Kaz -     Changed kASSelectGetSourceStyleNames to 0x1004 which TS uses.
  8. ////////////////////////////////////////////////////////////////////////////////
  9.  
  10. #ifndef __APPLESCRIPT__
  11. #define __APPLESCRIPT__
  12.  
  13. #ifndef __OSA__
  14. #include "OSA.h"
  15. #endif
  16. #ifndef __TEXTEDIT__
  17. #include "TextEdit.h"
  18. #endif
  19.  
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23.  
  24. ////////////////////////////////////////////////////////////////////////////////
  25. // Types and Constants
  26. ////////////////////////////////////////////////////////////////////////////////
  27.  
  28. #define typeAppleScript                    'ascr'
  29.  
  30. #define kAppleScriptSubtype                typeAppleScript
  31.     // The specific type for the AppleScript instance of the
  32.     // Open Scripting Architecture type.
  33.  
  34. #define typeASSourceType                typeChar
  35.     // Describes the minimum type necessary for OSACompile in AppleScript.
  36.  
  37. #define typeASStorage                    typeAppleScript
  38.  
  39. ////////////////////////////////////////////////////////////////////////////////
  40. // Component Selectors
  41. ////////////////////////////////////////////////////////////////////////////////
  42.  
  43. #define    kASSelectInit                    0x1001
  44. #define    kASSelectSetSourceStyles        0x1002
  45. #define    kASSelectGetSourceStyles        0x1003
  46. #define    kASSelectGetSourceStyleNames    0x1004
  47.  
  48. ////////////////////////////////////////////////////////////////////////////////
  49. // Initialization
  50. ////////////////////////////////////////////////////////////////////////////////
  51.  
  52. pascal OSAError
  53. ASInit(ComponentInstance    scriptingComponent,
  54.        long                    modeFlags,
  55.        long                    minStackSize,
  56.        long                    preferredStackSize,
  57.        long                    maxStackSize,
  58.        long                    minHeapSize,
  59.        long                    preferredHeapSize,
  60.        long                    maxHeapSize)
  61.     = ComponentCallNow(kASSelectInit, 28);
  62.     // This call can be used to explicitly initialize AppleScript.  If it is
  63.     // not called, the a scripting size resource is looked for and used. If
  64.     // there is no scripting size resource, then the constants listed below
  65.     // are used.  If at any stage (the init call, the size resource, the 
  66.     // defaults) any of these parameters are zero, then parameters from the
  67.     // next stage are used.  ModeFlags are not currently used.
  68.     // Errors:
  69.     //    errOSASystemError        initialization failed
  70.  
  71. // These values will be used if ASInit is not called explicitly, or if any
  72. // of ASInit's parameters are zero:
  73. #define kASDefaultMinStackSize                     1 * 1024
  74. #define kASDefaultPreferredStackSize             4 * 1024
  75. #define kASDefaultMaxStackSize                    16 * 1024
  76. #define kASDefaultMinHeapSize                     4 * 1024
  77. #define kASDefaultPreferredHeapSize                64 * 1024
  78. #define kASDefaultMaxHeapSize                    32 * 1024 * 1024
  79.  
  80. ////////////////////////////////////////////////////////////////////////////////
  81. // Source Styles
  82. ////////////////////////////////////////////////////////////////////////////////
  83.  
  84. pascal OSAError
  85. ASSetSourceStyles(ComponentInstance    scriptingComponent,
  86.                   STHandle            sourceStyles)
  87.     = ComponentCallNow(kASSelectSetSourceStyles, 4);
  88.     // Errors:
  89.     //    errOSASystemError        operation failed
  90.  
  91. pascal OSAError
  92. ASGetSourceStyles(ComponentInstance    scriptingComponent,
  93.                   STHandle*            resultingSourceStyles)
  94.     = ComponentCallNow(kASSelectGetSourceStyles, 4);
  95.     // Errors:
  96.     //    errOSASystemError        operation failed
  97.  
  98. pascal OSAError
  99. ASGetSourceStyleNames(ComponentInstance    scriptingComponent,
  100.                       long                modeFlags,
  101.                       AEDescList*        resultingSourceStyleNamesList)
  102.     = ComponentCallNow(kASSelectGetSourceStyleNames, 8);
  103.     // This call returns an AEList of styled text descriptors the names of the
  104.     // source styles in the current dialect.  The order of the names corresponds
  105.     // to the order of the source style constants, below.  The style of each
  106.     // name is the same as the styles returned by ASGetSourceStyles.
  107.     // 
  108.     // Errors:
  109.     //    errOSASystemError        operation failed
  110.  
  111. // Elements of STHandle correspond to following categories of tokens, and
  112. // accessed through following index constants:
  113. #define kASSourceStyleUncompiledText            0
  114. #define kASSourceStyleNormalText                1
  115. #define kASSourceStyleLanguageKeyword            2
  116. #define kASSourceStyleApplicationKeyword        3
  117. #define kASSourceStyleComment                    4
  118. #define kASSourceStyleLiteral                    5    
  119. #define kASSourceStyleUserSymbol                6
  120. #define kASSourceStyleAlias                        7
  121. #define kASNumberOfSourceStyles                    8
  122.  
  123. ////////////////////////////////////////////////////////////////////////////////
  124. #ifdef __cplusplus
  125. }
  126. #endif
  127. // You're still here?  Go home.
  128. #endif
  129. //////////////////////////////////////////////////////////////////////////////////////////////////////
  130.